package leetcode.秋招.网易;

import java.util.Scanner;

/**
 * @author ：zsy
 * @date ：Created 2021/8/21 15:01
 * @description：
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String next = in.nextLine();
        String[] s = next.split(" ");
        int[] nums = new int[s.length];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = Integer.parseInt(s[i]);
        }
        int M = in.nextInt();
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] + nums[j] <= M) count++;
            }
        }
        System.out.println(count);
    }
}
